<template>
	<view class="content">
		<template v-for="(item, index) in appCategoryList" :index="index">
			<applicationItem v-bind="item" />
		</template>
	</view>
	<u-overlay :show="mainStore.showTip" @click="closemask" :opacity="0.3"></u-overlay>
</template>
<script setup>
	import {
		useMainStore
	} from '@/store/index.js'
	import {
		computed
	} from 'vue';
	// 双重预防主模块
	import applicationItem from '../application-item.vue';
	const mainStore = useMainStore()
	const appCategoryList = computed(() => {
		if (mainStore.fastList.length > 0) {
			mainStore.fastList.forEach(item => {
				mainStore.mainList.forEach(item1 => {
					item1.appList.forEach(item2 => {
						if (item.name === item2.name) {
							console.log(item);
							item2.tip = true
						}
					})
				})
			})
		} else {
			mainStore.mainList.forEach(item1 => {
				item1.appList.forEach(item2 => {
					item2.tip = false
				})
			})
		}
		return mainStore.mainList
	})
	const closemask = () => {
		console.log('close');
		if (!mainStore.overlay) {
			mainStore.showTip = false
		}
		mainStore.overlay = false
		console.log(mainStore.overlay);
	}
</script>
<style lang="scss" scoped>
	.content {
		padding: 20rpx 20rpx 40rpx 20rpx;
	}
</style>